﻿<%@ Assembly Name="Microsoft.SharePoint.ApplicationPages, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%> <%@ Page Language="C#" Inherits="Microsoft.SharePoint.ApplicationPages.VersionsPage" MasterPageFile="~/_layouts/application.master"      %> <%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register TagPrefix="wssuc" TagName="ToolBar" src="~/_controltemplates/ToolBar.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ToolBarButton" src="~/_controltemplates/ToolBarButton.ascx" %>
<%@ Register Tagprefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import namespace ="Microsoft.SharePoint.Utilities" %>
<script language="C#" runat="server">
    protected override bool AllowAnonymousAccess
    {
	    get
	    {
		    return true;
	    }
    }
    
	string goBackText="";
	protected override void OnLoad(EventArgs e)
	{
		base.OnLoad(e);
		if (m_urlSource != null &&
			m_urlSource != "" &&
			List != null)
		{
			string strText;
			switch(List.BaseTemplate)
			{
				case SPListTemplateType.PictureLibrary:
				{
					strText = "versions_gobacktopiclib";
					break;
				}
				case SPListTemplateType.WebTemplateCatalog:
				case SPListTemplateType.ListTemplateCatalog:
				{
					strText = "versions_gobacktogallery";
					break;
				}
				case SPListTemplateType.DocumentLibrary:
				{
					strText = "versions_gobacktodoclib";
					break;
				}
				default:
				{
					strText = "versions_gobacktolist";
					break;
				}
			}
			strText = (string)(this.GetGlobalResourceObject("wss", strText));
			goBackText=strText;
		}
		else
		{
			goBackText=(string)(this.GetGlobalResourceObject("wss", "versions_gobacktogeneric"));
		}
	   if (List != null)
	   {
		   if (List.EnableModeration)
		   {
				 diidDeleteMinorVersions.Text = (string)(this.GetGlobalResourceObject("wss", "versions_delprevdraftversions"));
				 diidDeleteMinorVersions.ToolTip = (string)(this.GetGlobalResourceObject("wss", "versions_delprevdraftversions"));
		   }
		   else if (List.EnableMinorVersions)
		   {
				diidDeleteMinorVersions.Text = (string)(this.GetGlobalResourceObject("wss", "versions_delprevminorversions"));
				diidDeleteMinorVersions.ToolTip = (string)(this.GetGlobalResourceObject("wss", "versions_delprevminorversions"));
		   }
		   else
				diidDeleteMinorVersions.Visible = false;
		   MngVersionToolBar.Visible = List.DoesUserHavePermissions(SPBasePermissions.DeleteVersions);
	   }
	   txtItemOpenControl.Text = SPHttpUtility.HtmlEncode(OpenControl);
	   if (m_hasDocumentStream)
	   {
		   txtItemLinkHref.Text = SPHttpUtility.HtmlEncode(SPHttpUtility.UrlPathEncode(m_file.ServerRelativeUrl, true));
		   txtItemName.Text = SPHttpUtility.HtmlEncode(m_file.Name);
	   }
	   else if (m_item != null)
	   {
		   txtItemLinkHref.Text =  SPHttpUtility.HtmlEncode(SPHttpUtility.UrlPathEncode(List.Forms[PAGETYPE.PAGE_DISPLAYFORM].ServerRelativeUrl + "?ID=" + m_item.ID.ToString(),true));
		   string strTitle = m_item.DisplayName;
		   txtItemName.Text = SPHttpUtility.HtmlEncode(strTitle);
	   }
	   else
	   {
		   txtItemLinkHref.Text = string.Empty;
		   txtItemName.Text = string.Empty;
	   }
	}
</script>
<asp:Content ID="Content1" ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
	<SharePoint:EncodedLiteral ID="EncodedLiteral1" runat="server" text="<%$Resources:wss,versions_pagetitle%>" EncodeMethod='HtmlEncode'/>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
 <SharePoint:FormattedString EncodeMethod="NoEncode" FormatText="<%$Resources:wss,versions_versionssavedfor%>" id="VersionsSavedFor" runat="server" >
  <asp:Literal id="txtItemLinkHref" runat="server" />
  <asp:Literal id="txtItemOpenControl" runat="server" />
  <asp:Literal id="txtItemName" runat="server" />
 </SharePoint:FormattedString>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
<SCRIPT language="JavaScript">
var MSOWebPartPageFormName = <% SPHttpUtility.AddQuote(SPHttpUtility.EcmaScriptStringLiteralEncode(Form.Name),Response.Output); %>;
</SCRIPT>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderId="PlaceHolderPageImage" runat="server">
	<IMG SRC="/_layouts/images/blank.gif" width=1 height=1 alt="">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderId="PlaceHolderPageDescription" runat="server">
	<% if (VersioningEnabled)
		{
			if (List != null && List.BaseTemplate == SPListTemplateType.PictureLibrary)
			{
	%>
		<SharePoint:EncodedLiteral ID="EncodedLiteral2" runat="server" text="<%$Resources:wss,versions_Intro1a%>" EncodeMethod='HtmlEncode'/>
	<%
			} else if (List != null && List.BaseTemplate == SPListTemplateType.DocumentLibrary) {
	%>
		<SharePoint:EncodedLiteral ID="EncodedLiteral3" runat="server" text="<%$Resources:wss,versions_Intro1b%>" EncodeMethod='HtmlEncode'/>
	<%
			} else {
	%>
		<SharePoint:EncodedLiteral ID="EncodedLiteral4" runat="server" text="<%$Resources:wss,versions_Intro1e%>" EncodeMethod='HtmlEncode'/>
	<%
			}
		} else {
			if (List != null && List.BaseTemplate == SPListTemplateType.PictureLibrary)
			{
	%>
		<SharePoint:EncodedLiteral ID="EncodedLiteral5" runat="server" text="<%$Resources:wss,versions_Intro1c%>" EncodeMethod='HtmlEncode'/>
	<%
			} else if (List != null && List.BaseTemplate == SPListTemplateType.DocumentLibrary) {
	%>
		<SharePoint:EncodedLiteral ID="EncodedLiteral6" runat="server" text="<%$Resources:wss,versions_Intro1d%>" EncodeMethod='HtmlEncode'/>
	<%
			} else {
	%>
		<SharePoint:EncodedLiteral ID="EncodedLiteral7" runat="server" text="<%$Resources:wss,versions_Intro1f%>" EncodeMethod='HtmlEncode'/>
	<%
			}
		}
	%>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderId="PlaceHolderMain" runat="server">
<script language="javascript">
ctx = new ContextInfo();
ctx.isVersions = 1;
ctx.HttpRoot = <% SPHttpUtility.AddQuote(SPHttpUtility.EcmaScriptStringLiteralEncode(Web.Url),Response.Output); %>;
ctx.HttpPath = <% SPHttpUtility.AddQuote(SPHttpUtility.EcmaScriptStringLiteralEncode(SortUrl()),Response.Output); %>;
ctx.imagesPath = "/_layouts/images/";
ctx.verEnabled = <% SPHttpUtility.NoEncode(VersioningEnabled ? 1 : 0,Response.Output); %>;
ctx.isModerated = <% SPHttpUtility.NoEncode(Moderated ? "true" : "false",Response.Output); %>;
ctx.EnableMinorVersions = <% SPHttpUtility.NoEncode(MinorVersionEnabled ? "true" : "false",Response.Output); %>;
ctx.RecycleBinEnabled = <% SPHttpUtility.NoEncode(Site.WebApplication.RecycleBinEnabled ? 1 : 0,Response.Output); %>;
ctx.CurrentUserId = <% SPHttpUtility.NoEncode(Web.CurrentUser == null ? "-1": Web.CurrentUser.ID.ToString(),Response.Output);  %>;
ctxVer = ctx;
function deleteOnClick()
{
	DeleteAllVersions(<% SPHttpUtility.HtmlEncode((m_item != null) ? m_itemversions.Count.ToString(): m_fileversions.Count.ToString(), Response.Output);%>, ctxVer);
}
function deleteMinorOnClick()
{
	DeleteAllMinorVersions(<% SPHttpUtility.HtmlEncode((m_item != null) ? m_itemversions.Count.ToString(): m_fileversions.Count.ToString(), Response.Output);%>, ctxVer);
}
</script>
		<wssuc:ToolBar runat="server" id="MngVersionToolBar">
			<Template_Buttons>
				<wssuc:ToolBarButton runat="server" id="diidDeleteVersions"
					 AccessKey="X"
					 Text="<%$Resources:wss,versions_delprevversions%>"
					 ToolTip="<%$Resources:wss,versions_delprevversions%>"
					 NavigateUrl="javascript:deleteOnClick()"
				/>
				<wssuc:ToolBarButton runat="server" id="diidDeleteMinorVersions"
					 AccessKey="Z"
					 Text="<%$Resources:wss,versions_delprevminorversions%>"
					 ToolTip="<%$Resources:wss,versions_delprevminorversions%>"
					 NavigateUrl="javascript:deleteMinorOnClick()"
				/>
			</Template_Buttons>
		</wssuc:ToolBar>
		<!-- Version list -->
		<TABLE width="100%" border="0" cellpadding="1" cellspacing="0"  class="ms-settingsframe" style="border-top:0px solid">
		<% if (!m_hasDocumentStream) %>
		<% { %>
			<!-- List header -->
			<TR>
				<TH scope="col" nowrap class="ms-vh2-nofilter">
				<A id="diidVersionsSortNumber"  href=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(SortUrl("Number"),true),Response.Output); %> title="<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,versions_NumberColSort%>' EncodeMethod='HtmlEncode'/>">
						<ABBR title="<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,versions_NumberCol_title%>' EncodeMethod='HtmlEncode'/>"><SharePoint:EncodedLiteral ID="EncodedLiteral8" runat="server" text="<%$Resources:wss,versions_NumberCol%>" EncodeMethod='HtmlEncode'/></ABBR>
					</A>
					<% if (m_sortCol == "Number") %>
					<% { %>
						<IMG SRC=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(SortImage(),true),Response.Output); %> ALT=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SortAlt()),Response.Output); %> BORDER=0>
					<% } %>
				</TH>
				<TH scope="col" nowrap class="ms-vh2-nofilter">
					<A id="diidVersionsSortModified" href=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(SortUrl("Modified"),true),Response.Output); %> title="<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,versions_ModifiedColSort%>' EncodeMethod='HtmlEncode'/>" >
						<SharePoint:EncodedLiteral ID="EncodedLiteral9" runat="server" text="<%$Resources:wss,versions_ModifiedCol%>" EncodeMethod='HtmlEncode'/>
					</A>
					<% if (m_sortCol == "Modified") %>
					<% { %>
						<IMG SRC=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(SortImage(),true),Response.Output); %> ALT=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SortAlt()),Response.Output); %> BORDER=0>
					<% } %>
				</TH>
				<TH scope="col" nowrap class="ms-vh2-nofilter">
					<A id="diidVersionsSortModifiedBy"  href=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(SortUrl("ModifiedBy"),true),Response.Output); %> title="<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,versions_ModifiedByColSort%>' EncodeMethod='HtmlEncode'/>">
						<SharePoint:EncodedLiteral ID="EncodedLiteral10" runat="server" text="<%$Resources:wss,versions_ModifiedByCol%>" EncodeMethod='HtmlEncode'/>
					</A>
					<% if (m_sortCol == "ModifiedBy") %>
					<% { %>
						<IMG SRC=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(SortImage(),true),Response.Output); %> ALT=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SortAlt()),Response.Output); %> BORDER=0>
					<% } %>
				</TH>
			</TR>
			<% string itemLinkBase = m_list.Forms[PAGETYPE.PAGE_DISPLAYFORM].ServerRelativeUrl + "?ID=" + m_item.ID.ToString(); %>
			<% SPField fldCreatedBy = m_item.Fields.GetFieldByInternalName("Editor"); %>
			<!-- List items -->
			<% string  rowClass = "ms-alternating"; %>
			<% string  rowTitle = ""; %>
			<% for (int c = 0; c < m_itemversions.Count; ++c) %>
			<% { %>
				<% rowClass = (rowClass == "")? "ms-alternating" : "";     %>
				<% ISPItemVersion ver = (ISPItemVersion)m_itemversions[c]; %>
				<% if (ver.IsCur && ver.Level == SPFileLevel.Published) %>
				<% { %>
						<% if (MinorVersionEnabled) %>
						<% { %>
						   <TR>
								<% rowClass = "ms-sectionhighlight";  %>
								<TD class="ms-sectionhighlight-top" nowrap colspan="3" valign="top" style="padding-left: 5px">
									<SharePoint:EncodedLiteral ID="EncodedLiteral11" runat="server" text="<%$Resources:wss,versions_currentpublish%>" EncodeMethod='HtmlEncode'/>
								</TD>
						   </TR>
						<% } %>
						<% else if (Moderated) %>
						<% { %>
						   <TR>
							   <% rowClass = "ms-sectionhighlight";  %>
							   <TD class="ms-sectionhighlight-top" nowrap colspan="3" valign="top" style="padding-left: 5px">
								   <SharePoint:EncodedLiteral ID="EncodedLiteral12" runat="server" text="<%$Resources:wss,versions_currentapproved%>" EncodeMethod='HtmlEncode'/>
							   </TD>
						</TR>
						<% } %>
				<% } %>
				<TR class="<%=rowClass%>">
					<TD class="ms-vb2" valign="top" style="width: 15px">
						<% SPHttpUtility.HtmlEncode(ver.VersionLabel,Response.Output); %>
					</TD>
					<TD class="ms-vb-title" valign="top">
						<TABLE class="ms-unselectedtitle" onmouseover=OnItem(this) cellspacing="0"
							CTXName="ctxVer"
							ProgId=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(OpenControl),Response.Output); %>
							Id=<%SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(m_item.ID.ToString()),Response.Output); %>
							verId=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(ver.ID.ToString()),Response.Output); %>
							verUrl=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(ver.ID == (int)m_item["_UIVersion"] ? itemLinkBase + "&RootFolder=" + ver.ParentFolder: itemLinkBase + "&VersionNo=" + ver.ID.ToString() + "&RootFolder=" + ver.ParentFolder,true),Response.Output); %>
							isCur=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(ver.IsCur ? "1" : "0"),Response.Output); %>
							canViewproperty = "1";
							Level =<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(((byte)ver.Level).ToString()),Response.Output); %>
							OType= <%SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode((string)m_item["FSObjType"]),Response.Output); %>
							isMostCur=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(ver.ID == (int)m_item["_UIVersion"] ? "1" : "0"),Response.Output); %>
							Perm=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode("0x" + m_item.EffectiveBasePermissions.ToString("X")),Response.Output); %>
						 >
							<TBODY>
								<TR>
									<TD class="ms-vb" width="100%">
										<A onfocus=OnLink(this) href=
											<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(ver.ID == (int)m_item["_UIVersion"] ? itemLinkBase : itemLinkBase + "&VersionNo=" + ver.ID.ToString(),true),Response.Output); %>
										>
											<% SPHttpUtility.HtmlEncode(SPUtility.FormatDate(Web, ver.Created, SPDateFormat.DateTime),Response.Output); %>
										</A>
									</TD>
									<TD><img style="visibility:hidden" src="/_layouts/images/blank.gif" width="13" alt=""></TD>
								</TR>
							</TBODY>
						</TABLE>
					</TD>
					<TD class="ms-vb2" valign="top">
						<% if (ver.CreatedBy != null) %>
						<% { %>
							<% SPHttpUtility.NoEncode(ver.GetFieldValueAsHtml(fldCreatedBy),Response.Output); %>
						<% } %>
					</TD>
				</TR>
				<% Int32 prevverid = GetPrevItemVersionId(ver.ID); %>
				<% ISPItemVersion verprev = GetItemVersionById(prevverid); %>
				<% if (ver != null) %>
				<% { %>
					<TR class="<%=rowClass%>">
						<TD></TD>
						<TD colspan="2">
							<TABLE>
							<% Int32 numChanges = 0; %>
							<% foreach (SPField field in ver.Item.Fields) %>
							<% { %>
								<% if (field.ShowInVersionHistory) %>
								<% { %>
									<% bool bSuppressOldValues = false; %>
									<% if (field is SPFieldMultiLineText) %>
									<% { %>
										<% SPFieldMultiLineText fld = (SPFieldMultiLineText)field; %>
										<% if (fld.AppendOnly) %>
											<% bSuppressOldValues = true; %>
									<% } %>
									<% if (numChanges <= 15) %>
									<% { %>
										<% object val = ver.GetFieldValue(field); %>
										<% object valprev = null; %>
										<% if (verprev !=null) valprev = verprev.GetFieldValue(field); %>
										<% if (((val != null) ? val.ToString() : String.Empty) %>
										<%     != ((valprev != null) ? valprev.ToString() : String.Empty)) %>
										<% { %>
											<% if (++numChanges <= 15) %>
											<% { %>
													 <% rowTitle="";   %>
													 <% if ((!bSuppressOldValues) && (verprev != null)) %>
													 <% { %>
															  <%  rowTitle=(string)(this.GetGlobalResourceObject("wss", "versions_oldvalue")); %>
															  <%  rowTitle = rowTitle + verprev.GetTruncatedFieldValueAsText(field); %>
													 <% } %>
													<TR title=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(rowTitle),Response.Output); %> ID=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode("vv" + ver.ID.ToString() + field.InternalName),Response.Output); %> >
														 <TD class="ms-propertysheet" nowrap valign="top" width="100" colspan="2" style="padding-left: 5px">
															   <% SPHttpUtility.HtmlEncode(field.Title,Response.Output); %>
													</TD>
													<TD class="ms-vb" valign="top">
														<% SPHttpUtility.NoEncode(ver.GetTruncatedFieldValueAsHtml(field),Response.Output); %>
													</TD>
												</TR>
											<% } else {%>
												<TR>
													<TD class="ms-vb" nowrap valign="top" colspan="3" style="padding-left: 5px">
														<SharePoint:EncodedLiteral ID="EncodedLiteral13" runat="server" text="<%$Resources:wss,versions_more%>" EncodeMethod='HtmlEncode'/>
													</TD>
												</TR>
											<% } %>
										<% } %>
									<% } %>
								<% } %>
							<% } %>
							</TABLE>
						</TD>
					</TR>
					<% if ((ver.IsCur && ver.Level == SPFileLevel.Published) && (MinorVersionEnabled || Moderated))%>
						<% { %>
							  <TR><TD colspan="3" class="ms-sectionhighlight-line"></TD></TR>
						<% } %>
				<% } %>
			<% } %>
		<% } %>
		<% else %>
		<% { %>
			<!-- List header -->
			<TR>
				<TH scope="col" nowrap class="ms-vh2-nofilter">
					<A id="diidVersionsSortNumber" href=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(SortUrl("Number"),true),Response.Output); %> title="<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,versions_NumberColSort%>' EncodeMethod='HtmlEncode'/>" >
						<ABBR title="<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,versions_NumberCol_title%>' EncodeMethod='HtmlEncode'/>"><SharePoint:EncodedLiteral ID="EncodedLiteral14" runat="server" text="<%$Resources:wss,versions_NumberCol%>" EncodeMethod='HtmlEncode'/></ABBR>
					</A>
					<% if (m_sortCol == "Number") %>
					<% { %>
						<IMG SRC=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(SortImage(),true),Response.Output); %> ALT=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SortAlt()),Response.Output); %> BORDER=0>
					<% } %>
				</TH>
				<TH scope="col" nowrap class="ms-vh2-nofilter">
					<A id="diidVersionsSortModified"  href=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(SortUrl("Modified"),true),Response.Output); %> title="<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,versions_ModifiedColSort%>' EncodeMethod='HtmlEncode'/>">
						<SharePoint:EncodedLiteral ID="EncodedLiteral15" runat="server" text="<%$Resources:wss,versions_ModifiedCol%>" EncodeMethod='HtmlEncode'/>
					</A>
					<% if (m_sortCol == "Modified") %>
					<% { %>
						<IMG SRC=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(SortImage(),true),Response.Output); %> ALT=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SortAlt()),Response.Output); %> BORDER=0>
					<% } %>
				</TH>
				<TH scope="col" nowrap class="ms-vh2-nofilter">
					<A id="diidVersionsSortModifiedBy" href=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(SortUrl("ModifiedBy"),true),Response.Output); %> title="<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,versions_ModifiedByColSort%>' EncodeMethod='HtmlEncode'/>">
						<SharePoint:EncodedLiteral ID="EncodedLiteral16" runat="server" text="<%$Resources:wss,versions_ModifiedByCol%>" EncodeMethod='HtmlEncode'/>
					</A>
					<% if (m_sortCol == "ModifiedBy") %>
					<% { %>
						<IMG SRC=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(SortImage(),true),Response.Output); %> ALT=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SortAlt()),Response.Output); %> BORDER=0>
					<% } %>
				</TH>
				<TH scope="col" nowrap class="ms-vh2-nofilter">
					<A id="diidVersionsSortSize" href=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(SortUrl("Size"),true),Response.Output); %> title="<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,versions_SizeColSort%>' EncodeMethod='HtmlEncode'/>">
						<SharePoint:EncodedLiteral ID="EncodedLiteral17" runat="server" text="<%$Resources:wss,versions_SizeCol%>" EncodeMethod='HtmlEncode'/>
					</A>
					<% if (m_sortCol == "Size") %>
					<% { %>
						<IMG SRC=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(SortImage(),true),Response.Output); %> ALT=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SortAlt()),Response.Output); %> BORDER=0>
					<% } %>
				</TH>
				<TH scope="col" nowrap class="ms-vh2-nofilter">
					<A id="diidVersionsSortComments" href=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(SortUrl("Comments"),true),Response.Output); %>  title="<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,versions_CommentsColSort%>' EncodeMethod='HtmlEncode'/>">
						<SharePoint:EncodedLiteral ID="EncodedLiteral18" runat="server" text="<%$Resources:wss,versions_CommentsCol%>" EncodeMethod='HtmlEncode'/>
					</A>
					<% if (m_sortCol == "Comments") %>
					<% { %>
						<IMG SRC=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(SortImage(),true),Response.Output); %> ALT=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SortAlt()),Response.Output); %> BORDER=0>
					<% } %>
				</TH>
			</TR>
			<% string itemLinkBase = ""; %>
			<% if (m_list != null && m_item != null) %>
			<% { %>
				<% itemLinkBase = m_list.Forms[PAGETYPE.PAGE_DISPLAYFORM].ServerRelativeUrl + "?ID=" + m_item.ID.ToString(); %>
			<% } %>
			<!-- List files -->
			<% string  rowClass = "ms-alternating"; %>
			<% string  rowTitle = ""; %>
			<% for (int c = 0; c < m_fileversions.Count; ++c) %>
			<% { %>
				<% rowClass = (rowClass == "")? "ms-alternating" : "";     %>
				<% ISPFileVersion ver = (ISPFileVersion)m_fileversions[c]; %>
				<% ISPItemVersion itemcurr = (m_item != null) ? GetItemVersionById(ver.ID) : null; %>
				<% if (ver.IsCur && ver.Level == SPFileLevel.Published) %>
				<% { %>
						<% if (MinorVersionEnabled) %>
						<% { %>
						   <TR>
								<% rowClass = "ms-sectionhighlight";  %>
								<TD class="ms-sectionhighlight-top" nowrap colspan="5" valign="top" style="padding-left: 5px">
									<SharePoint:EncodedLiteral ID="EncodedLiteral19" runat="server" text="<%$Resources:wss,versions_currentpublish%>" EncodeMethod='HtmlEncode'/>
								</TD>
						   </TR>
						<% } %>
						<% else if (Moderated) %>
						<% { %>
						   <TR>
							   <% rowClass = "ms-sectionhighlight";  %>
							   <TD class="ms-sectionhighlight-top" nowrap colspan="5" valign="top" style="padding-left: 5px">
								   <SharePoint:EncodedLiteral ID="EncodedLiteral20" runat="server" text="<%$Resources:wss,versions_currentapproved%>" EncodeMethod='HtmlEncode'/>
							   </TD>
						</TR>
						<% } %>
				<% } %>
				<TR class="<%=rowClass%>">
					<TD class="ms-vb2" valign="top" style="width: 15px">
						<% SPHttpUtility.HtmlEncode(ver.VersionLabel,Response.Output); %>
					</TD>
					<TD class="ms-vb-title" valign="top" nowrap>
						<TABLE class="ms-unselectedtitle" onmouseover=OnItem(this) cellspacing="0"
							CTXName="ctxVer"
							ProgId=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(OpenControl),Response.Output); %>
							<% if (m_list != null && m_item != null) %>
							<% { %>
								Id=<%SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(m_item.ID.ToString()),Response.Output); %>
								Perm=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode("0x" + m_item.EffectiveBasePermissions.ToString("X")),Response.Output); %>
							<% } else { %>
								Perm=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode("0x" + Web.EffectiveBasePermissions.ToString("X")),Response.Output); %>
							<% } %>
							verId=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(ver.ID.ToString()),Response.Output); %>
							<% if (itemLinkBase != "") %>
							<% { %>
	                            <% if (ver.ID == m_file.UIVersion ) %>
	                            <% { %>
										verUrl=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(itemLinkBase + "&RootFolder=" + ver.ParentFolder,true),Response.Output); %>
									  <% } else { %>
										   verUrl=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(itemLinkBase + "&VersionNo=" + ver.ID.ToString() + "&RootFolder=" + ver.ParentFolder,true),Response.Output); %>
							  <% }} else { %>
								verUrl=<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(Web.Url + "/" + ver.Url,true),Response.Output); %>
							<% } %>
							isCur=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(ver.IsCur ? "1" : "0"),Response.Output); %>
							CanViewProperty =<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(ver.CanViewProperty ? "1" : "0"),Response.Output); %>
							Level =<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(((byte)ver.Level).ToString()),Response.Output); %>
							isMostCur=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(ver.ID == m_file.UIVersion ? "1" : "0"),Response.Output); %>
							oType = 0
							Type=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(HtmlType),Response.Output); %>
							<% if (ver.ID == m_file.UIVersion && CheckoutUserID != 0) %>
							<% { %>
								COUId=<%SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(CheckoutUserID.ToString()),Response.Output); %>
								<% if (m_file.CheckOutStatus == SPFile.SPCheckOutStatus.LongTermOffline) %>
								<% { %>
								IsCheckoutToLocal="1"
								<% } %>
							<% } %>
						>
							<TBODY>
								<TR>
									<TD class="ms-vb" width="100%" nowrap>
										<A onfocus=OnLink(this) href=
											<% if (m_isWebPartPage) %>
												<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(ver.ID == m_file.UIVersion ? itemLinkBase : itemLinkBase + "&VersionNo=" + ver.ID.ToString(),true),Response.Output); %>
											<% else %>
											<% { %>
												<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(Web.Url + "/" + ver.Url,true),Response.Output); %>
												 onclick=DispDocItem(this,<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(OpenControl),Response.Output); %>)
											<% } %>
										>
											<% SPHttpUtility.HtmlEncode(SPUtility.FormatDate(Web, ver.Created, SPDateFormat.DateTime),Response.Output); %>
										</A>
									</TD>
									<TD><img style="visibility:hidden" src="/_layouts/images/blank.gif" width="13" alt=""></TD>
								</TR>
							</TBODY>
						</TABLE>
					</TD>
					<TD class="ms-vb2" valign="top" nowrap>
						<% if (itemcurr != null && itemcurr.CreatedBy != null) %>
						<% { %>
							<% SPField fldCreatedBy = m_item.Fields.GetFieldByInternalName("Editor"); %>
							<% SPHttpUtility.NoEncode(itemcurr.GetFieldValueAsHtml(fldCreatedBy),Response.Output); %>
						<% } %>
						<% else if (ver.CreatedBy != null) %>
						<% { %>
							<% SPHttpUtility.HtmlEncode(ver.CreatedBy,Response.Output); %>
						<% } %>
					</TD>
					<TD class="ms-vb2" valign="top" nowrap>
						<% SPHttpUtility.HtmlEncode(SPUtility.FormatSize(ver.Size),Response.Output); %>
					</TD>
					<TD class="ms-vb2" valign="top">
						<% SPHttpUtility.HtmlEncodeAllowSimpleTextFormatting(ver.CheckInComment,Response.Output); %>
					</TD>
				</TR>
				<% if (m_item != null) %>
				<% { %>
					<% Int32 prevverid = GetPrevFileVersionId(ver.ID); %>
					<% ISPItemVersion itemprev = GetItemVersionById(prevverid); %>
					<% if (itemcurr != null) %>
					<% { %>
						<TR class="<%=rowClass%>">
							<TD></TD>
							<TD colspan="4">
								<TABLE>
								<% Int32 numChanges = 0; %>
								<% foreach (SPField field in itemcurr.Item.Fields) %>
								<% { %>
									<% if (field.ShowInVersionHistory) %>
									<% { %>
										<% bool bSuppressOldValues = false; %>
										<% if (field is SPFieldMultiLineText) %>
										<% { %>
											<% SPFieldMultiLineText fld = (SPFieldMultiLineText)field; %>
											<% if (fld.AppendOnly) %>
												<% bSuppressOldValues = true; %>
										<% } %>
										<% if (numChanges <= 15) %>
										<% { %>
											<% object val = itemcurr.GetFieldValue(field); %>
											<% object valprev = null; %>
											<% if (itemprev != null) valprev = itemprev.GetFieldValue(field); %>
											<% if (((val != null) ? val.ToString() : String.Empty) %>
											<%     != ((valprev != null) ? valprev.ToString() : String.Empty)) %>
											<% { %>
												<% if (++numChanges <= 15) %>
												<% { %>
													 <% rowTitle="";   %>
													 <% if ((!bSuppressOldValues) && (itemprev != null)) %>
													 <% { %>
															  <%  rowTitle=(string)(this.GetGlobalResourceObject("wss", "versions_oldvalue")); %>
															  <%  rowTitle = rowTitle + itemprev.GetTruncatedFieldValueAsText(field); %>
													 <% } %>
													<TR title=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(rowTitle),Response.Output); %> ID=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode("vv" + ver.ID.ToString() + field.InternalName),Response.Output); %> >
														<TD class="ms-propertysheet" nowrap valign="top" width="100" colspan="2" style="padding-left: 5px">
															<% SPHttpUtility.HtmlEncode(field.Title,Response.Output); %>
														</TD>
														<TD valign="top" class="ms-vb" >
															<% SPHttpUtility.NoEncode(itemcurr.GetTruncatedFieldValueAsHtml(field),Response.Output); %>
														</TD>
													</TR>
												<% } else {%>
													<TR>
														<TD class="ms-vb" nowrap valign="top" colspan="3" style="padding-left: 5px">
															<SharePoint:EncodedLiteral ID="EncodedLiteral21" runat="server" text="<%$Resources:wss,versions_more%>" EncodeMethod='HtmlEncode'/>
														</TD>
													</TR>
												<% } %>
											<% } %>
										<% } %>
									<% } %>
								<% } %>
								</TABLE>
							</TD>
						</TR>
						<% if ((ver.IsCur && ver.Level == SPFileLevel.Published) && (MinorVersionEnabled || Moderated))%>
						<% { %>
							  <TR><TD colspan="5" class="ms-sectionhighlight-line"></TD></TR>
						<% } %>
					<% } %>
				<% } %>
			<% } %>
		<% } %>
		</TABLE>
</asp:Content>
